import { BubbleCfgBase } from "./Sheets"
import { SheetManager } from "../../ccc3-framework-core/framework/modules/sheetManager";
import { bubbleType } from "../../scripts/CustomDefine";
export class BubbleCfg extends BubbleCfgBase {
  //id索引
  public static get(id: any) {
    if ((this as any)[id]) return (this as any)[id];
    return SheetManager.get("BubbleCfg", id, BubbleCfg);
  }
  public static getAll(): BubbleCfg[] {
    return SheetManager.getAllSheets("BubbleCfg", BubbleCfg);
  }
  public static getRandom(type: bubbleType): string {
    let all = this.getAll();
    let filter = all.filter(item => item.type == type);
    let index = Math.floor(Math.random() * filter.length);
    return filter[index].memo;
  }

}